#ifndef DEFINES_H
#define DEFINES_H

//MainWindow

#define MAINTITLE    "Mantiss 0.9.0"

#define UP	     25
#define DOWN	     25

#define XSHIFT	     5
#define YSHIFT	     5
#define SPACE	     5
#define WIDTH1	     650
#define WIDTH2	     240
#define HEIGHT1	     310
#define HEIGHT2	     160
#define HEIGHT3	     170

#define WTABSITEM    WIDTH1+SPACE+WIDTH2-XSHIFT*2-10
#define HTABSITEM    HEIGHT3-YSHIFT*2-30

#define WMAIN        WIDTH1+WIDTH2+SPACE+XSHIFT*2
#define HMAIN	     HEIGHT1+HEIGHT2+HEIGHT3+YSHIFT*0+SPACE*2+UP+DOWN	     
/* #define WMAIN        920 */
/* #define HMAIN	     720 */

#define WPIC	     500
#define HPIC	     230

#define WCHART       660
#define HCHART	     310

#define WTABS	     660+240*1+10*2
#define HTABS	     172

#define WCHARTPARTS  WTABS-20
/* #define WCHARTPARTS  640 */
#define HCHARTPARTS  140

#define XSMALLCHART  3
#define YSMALLCHART  3

#define SPACETABLE   10

#define WRESULT	     240
#define HRESULT	     HMAIN-UP-DOWN-HTABS-15

#define WCELLEDIT    120
#define WBUTTON	     25
#define HCELLEDIT    20
#define ROWSCOUNT    24

/* #define WGROUPBOX    WTABS-20 */
#define WGROUPBOX    WCHART
#define HGROUPBOX    160

#define CHARTPREC    3
#define OUTPREC      0.001
#define STRPREC	     10

//GroupControl

#define GLEFTIDENT   10
#define GUPIDENT     25
#define GUPSLIDER    25
#define GUPNEXTELEM  35
#define GRIGHTSPACE  100
#define GLEFTSPACE   70

#define DEFMINBSL    1
#define DEFMAXBSL    500
#define DEFMINBSP    0.01
#define DEFMAXBSP    5

#define DEFMINHSL    10
#define DEFMAXHSL    500
#define DEFMINHSP    0.1
#define DEFMAXHSP    5

#define DEFMINASL    10
#define DEFMAXASL    89
#define DEFMINASP    10
#define DEFMAXASP    89

//TrayToolKit

//Случаи:
//Симметричный трапецеидальный лоток        "\_/"
#define SYMTTRAPEZE      100
//Асимметричный трапецеидальный лоток	    "|_/"
#define ASYMTTRAPEZE	 101
//Условно Прямоугольный лоток				    "|_|"
#define RECTANGLE	 102

//Обозначения переменных
#define VAR_TYPE	401
#define VAR_B		402
#define VAR_H		403
#define VAR_HR		404
#define VAR_M		405
#define VAR_I		406
#define VAR_IR		407
#define VAR_F		408
#define VAR_P		409
#define VAR_ANGLE	410
#define VAR_L		411

//Константы
#define VAR_G		412
#define VAR_A		413
#define VAR_Q20		414

#define PI		3.14

//Условия
#define VAR_CONCRETE	415
#define VAR_REGION	416
#define VAR_TYPEUPSIDE	417
#define VAR_TIMERAIN	418
#define VAR_CLCONCRETE	419

//Зависимые от условий переменные
#define VAR_N	        420
#define VAR_CN		421
#define VAR_MR		422
#define VAR_CY		423
#define VAR_ZMID	424
#define VAR_KPF		425
#define VAR_KPT		426
#define VAR_HRAIN	427

//Значение по умолчанию 
#define DEFTRAYTYPE	 SYMTTRAPEZE
#define DEFWIDTH	 0.5
#define DEFHEIGHT	 0.6
#define DEFINCL	 	 1
#define DEFHYDRINCL	 0.003
#define DEFAREARUNNER	 0.5
#define DEFLIMPERIOD	 5

#define DEFG		 9.8
#define DEFA		 1.1
#define DEFQ20		 200

#define DEFLENGTH	 50.0
#define DEFCONCRETE	 2
#define DEFREGION	 1
#define DEFTYPEUPSIDE	 5
#define DEFTIMERAIN	 9
#define DEFCLCONCRETE	 6

#define DEFWRECTTRAY	 WCHART
#define DEFHRECTTRAY	 HCHART
#define DEFXSHIFTTRAY	 0
#define DEFYSHIFTTRAY	 0
#define DEFSIZECELL	 50

#define DEFWRECTPARTS	 WTABSITEM
#define DEFHRECTPARTS	 HTABSITEM-20
/* #define DEFWRECTPARTS	 WCHARTPARTS */
/* #define DEFHRECTPARTS	 HCHARTPARTS-20 */
#define DEFXSHIFTPARTS	 0
#define DEFYSHIFTPARTS	 20
#define DEFSIZECELL2	 10

#define PRECISION	 1000

#define MAXPARTSITEMS	30

#define EDIT_N		301
#define EDIT_REGION	302
#define EDIT_P		303
#define EDIT_I		304
#define EDIT_F		305
#define EDIT_Q20	306
#define EDIT_ZMID	307
#define EDIT_T		308
#define EDIT_IR		309
#define EDIT_HR		310
#define EDIT_CLCONCRETE	311
#define EDIT_LEN	312

//Result

//Константы для updateVar
#define VAR_AREA	201
#define VAR_PERIMETER	202
#define VAR_RADIUS	203
#define VAR_SHEZY	204
#define VAR_QCON	205
#define VAR_QRAINCON	206
#define VAR_QR		207
#define VAR_QCR		208
#define VAR_HCR		209
#define VAR_ICR		210
#define VAR_VS		211
#define VAR_VR		212
#define VAR_VD		213
#define VAR_V		214
#define VAR_AQ		215
#define VAR_EMPTY	216
#define VAR_QREC	217
#define VAR_HREC	218

#define INDENTVARH	20
#define INDENTVARV	20
#define SPACEVAR	30

#define VAR1		INDENTVARV + SPACEVAR*0
#define VAR2		INDENTVARV + SPACEVAR*1
#define VAR3		INDENTVARV + SPACEVAR*2
#define VAR4		INDENTVARV + SPACEVAR*3
#define VAR5		INDENTVARV + SPACEVAR*4
#define VAR6		INDENTVARV + SPACEVAR*5
#define VAR7		INDENTVARV + SPACEVAR*6
#define VAR8		INDENTVARV + SPACEVAR*7
#define VAR9		INDENTVARV + SPACEVAR*8
#define VAR10		INDENTVARV + SPACEVAR*9

//Отступ по Y для QLabel
#define AREA_Y		VAR6		
#define PERIMETER_Y	VAR7
#define RADIUS_Y	VAR8
#define SHEZY_Y		VAR9
#define QCON_Y		VAR10
#define QRAINCON_Y	VAR1
#define HRAIN_Y		VAR5
#define QR_Y		VAR4
#define HCR_Y		VAR2
#define ICR_Y		VAR3

//Единицы измерения для TrayToolKit
#define EMPTY_DIM		""

#define S_DIM_HTML		"м<sup>2</sup>"
#define X_DIM_HTML		"м"
#define R_DIM_HTML		"м"
#define C_DIM_HTML 		"м<sup>0.5</sup>/с"
#define Q_DIM_HTML    		"м<sup>3</sup>/с"
#define H_DIM_HTML    		"м"
#define V_DIM_HTML    		"м/с"
#define B_DIM_HTML    		"м"
#define G_DIM_HTML		"м/с<sup>2</sup>"
#define P_DIM_HTML		"лет"
#define T_DIM_HTML		"мин"
#define Q20_DIM_HTML		"л/с на га"
#define L_DIM_HTML		"м"
#define F_DIM_HTML		"га"

#define S_DIM_TEXT		"м2"
#define X_DIM_TEXT		"м"
#define R_DIM_TEXT   		"м"
#define C_DIM_TEXT    		"м0.5/с"
#define Q_DIM_TEXT    		"м3/с"
#define H_DIM_TEXT	   	"м"
#define V_DIM_TEXT	 	"м/с"
#define B_DIM_TEXT	   	"м"
#define G_DIM_TEXT		"м/с2"
#define P_DIM_TEXT		"лет"
#define T_DIM_TEXT		"мин"
#define Q20_DIM_TEXT		"л/с на га"
#define L_DIM_TEXT		"м"
#define F_DIM_TEXT		"га"

#include <math.h>

#endif
